package com.cjm.algorithm.leetcode;

public class MaxRotateFunction396 {
    public int maxRotateFunction1(int[] nums) {
        int length = nums.length;
        int[] count = new int[nums.length];
        for (int i = 0; i < length; i++) {
            int cur = nums[i];
            for (int j = 0; j < length; j++) {

            }
        }
        return 0;
    }
    // 超出时间限制
    public int maxRotateFunction(int[] nums) {
        int count = 0;
        int start = 0;
        int sum = Integer.MIN_VALUE;
        while (count < nums.length) {
            count++;
            int cur = start++;
            int curSum = 0;
            for (int i = 0; i < nums.length; i++) {
                curSum += cur * nums[i];
                cur++;
                if (cur > nums.length - 1) {
                    cur = 0;
                }
            }
            sum = Math.max(sum, curSum);
        }
        return sum;
    }

    public static void main(String[] args) {
        MaxRotateFunction396 maxRotateFunction396 = new MaxRotateFunction396();
        int[] nums = new int[]{100};
        System.err.println(maxRotateFunction396.maxRotateFunction(nums));
    }
}
